package com.kx.center.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties({
	"salt", "password", "token"
})
@SuppressWarnings("serial")
public class Account implements java.io.Serializable {
	private int id;
	private int departmentId;
	private String loginName;
  	private String password;
  	private String salt;
  	private String userName;
	private String email;
	private boolean subscribe;
	private Date createDate;
	private Date updateDate;
	private int roleId;
	private int status;
	private String token;
	private int companyId;
	private int operatorId;
	
	public Account(){
		
	}
	
	public Account(String loginName, String password){
		this(0, loginName, password, null, null, null, true, null, null, 0);
	}
	
	public Account(int id, String loginName, String password, String salt, String userName, String email, boolean subscribe, Date createDate, Date updateDate, int status) {
		this.id = id;
		this.loginName = loginName;
		this.password = password;
		this.salt = salt;
		this.userName = userName;
		this.email = email;
		this.subscribe = subscribe;
		this.createDate = createDate;
		this.updateDate = updateDate;
		this.status = status;
	}

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getSalt() {
		return salt;
	}
	public void setSalt(String salt) {
		this.salt = salt;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}

	public boolean isSubscribe() {
		return subscribe;
	}

	public void setSubscribe(boolean subscribe) {
		this.subscribe = subscribe;
	}

	public int getStatus(){
		return status;
	}
	public void setStatus(int status){
		this.status = status;
	}
	public Date getCreateDate(){
		return createDate;
	}
	public void setCreateDate(Date createDate){
		this.createDate = createDate;
	}
	public Date getUpdateDate(){
		return updateDate;
	}
	public void setUpdateDate(Date updateDate){
		this.updateDate = updateDate;
	}
	public boolean isBanned() {
		return (status == 100L);
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public int getOperatorId() {
		return operatorId;
	}

	public void setOperatorId(int operatorId) {
		this.operatorId = operatorId;
	}

	public int getCompanyId() {
		return companyId;
	}

	public void setCompanyId(int companyId) {
		this.companyId = companyId;
	}

	public int getRoleId() {
		return roleId;
	}

	public void setRoleId(int roleId) {
		this.roleId = roleId;
	}

	public int getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(int departmentId) {
		this.departmentId = departmentId;
	}

}
